package com.example.shopping.dao;

import com.example.shopping.pojo.Commodity;
import com.example.shopping.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/*
Create by 苍狼 于 2020/1/16
站在巅峰看世界，
落在深渊思人生。
*/
//商品表
@Repository
public interface ICommodityDao {
    //全部查询商品审核信息
    @Select("select * from commodity")
    List<Commodity> selectCommodityList();

    //根据名字模糊查询
    @Select("select * from commodity where `name` like #{name}")
    List<Commodity> selectCommodityByLikeName(String name);

    //删除商品审核信息
    @Delete("delete from commodity where id=#{id} ")
    int deleteCommodityById(int id);

    //审核根据状态查询
    @Select("select * from commodity where `status` like #{status}")
    List<Commodity> selectCommodityByStatus(int status);
}

